package poo.main;

import poo.banca.ContoBancario;
import poo.banca.ContoConFido;

public class TestContoConFido {

	static ContoBancario clientela[] = new ContoBancario[100];
	static int size = 0;

	public static void main(String[] args) {

		ContoBancario cb = new ContoBancario("51/3742/53", 1000);
		ContoConFido cf = new ContoConFido("52/2233/44", 10000, 5000);

		cb.deposita(50);
		if (cf.preleva(2000)) {
			cf.setFido(7500);
		}
		double f = cf.getFido();
		System.out.println(cf.saldo() + "\nFido= " + f);

		ContoBancario cd = new ContoConFido("52/3434/12", 8000);

		if (cd instanceof ContoBancario) {
			System.out.println("LEL");
		}

		clientela[0] = new ContoBancario("51/4252", 1500);
		size++;
		clientela[1] = new ContoConFido("52/2212", 10000, 7000);
		size++;

		premi();

		report();

	}

	public static void report() {
		for (int i = 0; i < size; i++)
			System.out.println(clientela[i]);
	}

	public static void premi() {
		for (int i = 0; i < size; i++) {
			if (clientela[i] instanceof ContoConFido) {
				ContoConFido cf = (ContoConFido) clientela[i];
				cf.setFido(cf.getFido() + 200);
			} else
				clientela[i].deposita(50);
		}
	}

}
